package com.api.volunteer.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Date;

/**
 * @author 邹宇杰
 * @email 2901570623@qq.com
 * @date 2022/4/1 10:49
 */
@Entity
@Table(name = "T004_VOLUNTEERACTIVITIES")
@Data
public class VolunteerActivities extends BaseEntity{

    @Id
    @GenericGenerator(name = "uuidG", strategy = "org.hibernate.id.UUIDGenerator")
    @GeneratedValue(generator = "uuidG")
    @Column(name = "T_VOLUNTEERACTIVITIES_ID", length = 50)
    private String id;

    @Column(name = "T_VOLUNTEERACTIVITIES_VOLUNTEERNAME")
    private String volunteerName;

    @Column(name = "T_VOLUNTEERACTIVITIES_VOLUNTEERCONTENT")
    private String volunteerContent;

    @Column(name = "T_VOLUNTEERACTIVITIES_VOLUNTEERTYPE")
    @Enumerated(value = EnumType.STRING)
    private VolunterrType volunterrType;

    @Column(name = "T_VOLUNTEERACTIVITIES_OPENID")
    private String openid;

    @Column(name = "T_VOLUNTEERACTIVITIES_BEGINDATE")
    @Temporal(TemporalType.TIMESTAMP)
    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
    private Date beginDate;

    @Column(name = "T_VOLUNTEERACTIVITIES_ENDDATE")
    @Temporal(TemporalType.TIMESTAMP)
    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
    private Date endDate;

    @Column(name = "T_VOLUNTEERACTIVITIES_AWARDSCORE")
    private Integer awardScore;

    @Column(name = "T_VOLUNTEERACTIVITIES_CHECKNUMBER")
    private Integer checkNumber;

    @Column(name = "T_VOLUNTEERACTIVITIES_ADDRESS")
    private String address;

    /**
     * 志愿活动最大参加人数
     */
    @Column(name = "T_VOLUNTEERACTIVITIES_MAXNUMBER")
    private Integer maxNumber;
}
